﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

namespace Server
{
    class Player
    {
        static UniqueIDGenerator m_IDGenerator = new UniqueIDGenerator();
        public uint m_UserID { private set; get; }
        public uint m_PlayerID { private set; get; }
        public Vector3 m_Pos;
        public string m_NickName;
        uint m_LastPosSyncTickCount;

        public Player(uint userId)
        {
            m_UserID = userId;
            m_PlayerID = m_IDGenerator.GetUniqueID(); 
        }

        public void UpdatePos(uint tickCount, Vector3 pos)
        {
            if (tickCount <= m_LastPosSyncTickCount)
            {
                return;
            }
            m_LastPosSyncTickCount = tickCount;
            m_Pos = pos;
        }
    }
}
